home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Format (UK) 188
/
01-04 PC Format 188 [2006-06] DVD side 1_.iso
/
Menus
/
Scenes
/
HOME.dir
/
00021_Script_DockHandler
< prev
next >
Wrap
Text File
|
2006-04-20
|
2KB
|
126 lines
global dock
global mKey
global itemSpList
global cList
global Active_mKey
property myStartPos
property myDockNum
property myScaler
property Sp
property myPos
property myTxt
property clicked
property myPath
on init me, aPos, aNum, aPath, aSpriteNum
myStartPos = vector(aPos.locH, aPos.locV, 0)
myPos = myStartPos
myDockNum = aNum
myPath = aPath
Sp = sprite(aSpriteNum)
myScaler = 0
myDir = 0
myTxt = sprite(Sp.spritenum + 1)
lf = myStartPos.x - (dock.bWidth / 2)
tp = myStartPos.y - (dock.bWidth / 2)
rt = myStartPos.x + (dock.bWidth / 2)
bt = myStartPos.y + (dock.bWidth / 2)
Sp.rect = rect(lf,tp,rt,bt)
end
on exitframe me
if the mouseV < 570 then
mPos = vector(the mouseH, the mouseV, 0)
myDist = mPos.distanceTo(myPos)
Dock.distList[myDockNum] = myDist
if myDist < dock.minDist then
myScaler = (dock.minDist - myDist) / dock.minDist
myWidth = dock.bWidth + (dock.widthDif * myScaler)
else
myWidth = dock.bWidth
myPos = myStartPos
if clicked = false then
myTxt.visible = false
end if
end if
myTxt.loc = point((myPos.x - (myTxt.width / 2)), myPos.y - (myWidth / 1.2))
lf = myPos.x - (myWidth / 2)
tp = myPos.y - (myWidth / 2)
rt = myPos.x + (myWidth / 2)
bt = myPos.y + (myWidth / 2)
Sp.rect = rect(lf,tp,rt,bt)
if dock.biggestBut = myDockNum then
if myDist < dock.minDist then
myTxt.visible = true
end if
else
myTxt.visible = false
end if
else
myWidth = dock.bWidth
myPos = myStartPos
if clicked = false then
myTxt.visible = false
end if
end if
end
on mouseUp me
if clicked <> true then
clearScriptedSprites(cList.mainmenu)
clearScriptedSprites(cList.itemmenu)
sendAllsprites(#UnclickDock)
-- myTxt.member.color = rgb(255,255,255)
-- Sp.color = rgb(255,255,255)
clicked = true
GenPane(myDockNum)
Active_mKey = myDockNum
else
shrinkmenuframes
clearScriptedSprites(cList.itemmenu)
sendAllsprites(#UnclickDock)
clicked = false
end if
end
on UnclickDock
if clicked = true then
shrinkmenuframes
end if
Sp.color = rgb(0,0,0)
myTxt.member.color = rgb(255,255,255)
clicked = false
end
on mouseEnter me
end